package com.doit.demo02;

public class test {
    public static void main(String[] args) {

        Demo_Runnable m = new Demo_Runnable();
        Thread t = new Thread(m);
        t.start();
        for (int i = 0; i < 50; i++) {
            System.out.println(Thread.currentThread().getName()+" "+i);
        }
        Runnable runnable = new Runnable() {//秒懂,因为他是接口,里面都是抽象方法,使用的时候必须重写方法,跟类的使用方法一致,只不过它必须重写方法罢了

            @Override
            public void run() {
                for (int i = 0; i < 50; i++) {

                    System.out.println("吃屎是不能解决问题的");
                }
            }
        };
        Thread t2 = new Thread(runnable);
        t2.start();
    }

}
